package com.agile.leetcode.tomcat.servlet;

import com.agile.leetcode.tomcat.anotation.Address;
import com.agile.leetcode.tomcat.abstractservlet.MyHttpServlet;
import com.agile.leetcode.tomcat.netty.NettyRequest;
import com.agile.leetcode.tomcat.netty.NettyResponse;
import com.agile.leetcode.tomcat.nio.MyNioRequest;
import com.agile.leetcode.tomcat.nio.MyNioResponse;
import com.agile.leetcode.tomcat.normalio.MyRequest;
import com.agile.leetcode.tomcat.normalio.MyResponse;

import java.io.IOException;

/**
 * 自定义第二个servlet
 *
 * @Author KD
 * @Date 2021/2/6 14:19
 */
@Address("/nzq")
public class HisServlet extends MyHttpServlet {
    @Override
    public void doGet(NettyRequest request, NettyResponse response) {

    }

    @Override
    public void doPost(NettyRequest request, NettyResponse response) {

    }

    @Override
    public void doGet(MyRequest request, MyResponse response) {
        try {
            response.write("nzq");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void doGet(MyNioRequest request, MyNioResponse response) {
        response.write("nio nzq");
    }

    @Override
    public void doPost(MyRequest request, MyResponse response) {
        doGet(request, response);
    }

    @Override
    public void doPost(MyNioRequest request, MyNioResponse response) {
        doGet(request,response);
    }
}
